package com.cxq.dataStructrue;

import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        String s1 = "123";
        String s2 = "123";
        System.out.println(s1 == s2);
    }

    public static void test1() {
        int[][] arr = new int[2][3];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.println(arr[i][j]);
            }
        }
    }

    public static void test2() {
        String s = "we are friend!";
        String s1 = s.replaceAll(" ", "%20");
        System.out.println(s1);
    }
}
class CQueue {

    private Stack<Integer> stack1;
    private Stack<Integer> stack2;
    public CQueue() {
        stack1 = new Stack<>();
        stack2 = new Stack<>();
    }

    public void appendTail(int value) {
        if(stack1.size() != 0){
            stack1.push(value);
        }
        if(stack2.size() != 0){
            stack2.push(value);
        }
        if(stack1.size() == 0 && stack2.size() == 0){
            stack1.push(value);
        }
        if(stack1.size() !=0 && stack2.size() !=0){
            System.out.println("出错啦！");
        }

    }

    public int deleteHead() {
        if(stack1.size() == 0 && stack2.size() == 0){
            return -1;
        }else if(stack1.size() != 0 && stack2.size() == 0){
            while(!stack1.isEmpty()){
                stack2.push(stack1.pop());
            }
            return stack2.pop();
        }else if(stack1.size() == 0 && stack2.size() != 0){
            while(!stack2.isEmpty()){
                stack1.push(stack2.pop());
            }
            return stack1.pop();
        }else {
            return -1;
        }
    }
}